<?php


use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Articles';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= Html::encode($this->title) ?></h3>
                <div class="box-tools">

                </div>
            </div>
            <div class="box-body table-responsive">
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'tableOptions' => ['class' => 'table table-hover'],
        'columns' => [
            [
                'class' => 'yii\grid\SerialColumn',
                'visible' => false,
            ],

            'id',
            //'slug',
            'title',
            //'body:ntext',
            'view',
            //'category_id',
            //'thumbnail_base_url:url',
            //'thumbnail_path',
            'status',
            //'created_by',
            //'updated_by',
            'published_at',
            //'created_at',
            //'updated_at',
            [
                'class' => 'yii\grid\ActionColumn',
                'header' => '操作',
                'template' => '{edit} {status} {delete}',
                'buttons' => [
//                'edit' => function($url, $model, $key){
//                        return Html::edit(['edit', 'id' => $model->id]);
//                },
//               'status' => function($url, $model, $key){
//                        return Html::status($model['status']);
//                  },
//                'delete' => function($url, $model, $key){
//                        return Html::delete(['delete', 'id' => $model->id]);
//                },
                ]
            ]
    ]
    ]); ?>
            </div>
        </div>
    </div>
</div>
